package com.sz.biz.logistics.billing.dto;

import com.sz.biz.logistics.core.entity.ProductServiceRel;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Function: 销售价格计算对象. <br>
 * Date: 2017年04月05日 17:54 <br>
 * Author: wentao.chang
 */
public class QuotationCalcObject extends QuotationBaseCalcObject implements Serializable {
    /**
     * 客户id
     */
    protected int customerId;

    /**
     * 客户的使用货币code
     */
    protected String currencyCode;

    /**
     * 客户货币code
     */
    protected String custCurrencyCode;
    /**
     * 客户货币金额
     */
    protected BigDecimal custCurrencyAmount;
    /**
     * 汇率
     */
    protected BigDecimal exchangeRate;

    /**
     * 汇率是否设置
     */
    protected boolean isExchangeRateSetting = true;
    /**
     * 套餐code
     *
     * @param
     */
    protected String comboCode;

    /**
     * 声明价值
     */
    protected BigDecimal announcePrice=BigDecimal.ZERO;
    /**
     * 服务分派中规划的服务列表
     */
    protected List<String> assignedServiceUids=new ArrayList<>();

    /**
     * 已选的可选服务的类型
     */
    protected List<String> optionServices;
    /**
     * 是否计算所有的可选服务
     */
    protected boolean isCalcAlloption;
    /**
     * 是否试算
     */
    protected boolean isTry;

    /**起止港*/
    protected int startPort;
    protected int endPort;

    protected boolean isFromPre=false;

    //无订单试算
    public QuotationCalcObject(String cargoTypeCode,
                               BigDecimal weight, BigDecimal volume, String unitCode,
                               String fromCountry, String fromProvince,
                               String fromCity, String fromArea, String fromStreet,
                               String fromPostcode,
                               String toCountry, String toProvince,
                               String toCity, String toArea, String toStreet,
                               String toPostcode) {

        super.cargoTypeCode = cargoTypeCode;
        super.weight = weight;
        super.volume = volume;
        super.weightUnit = unitCode;
        super.fromCountry = fromCountry;
        super.fromProvince = fromProvince;
        super.fromCity = fromCity;
        super.fromArea = fromArea;
        super.fromStreet = fromStreet;
        super.fromPostcode = fromPostcode;
        super.toCountry = toCountry;
        super.toProvince = toProvince;
        super.toCity = toCity;
        super.toArea = toArea;
        super.toStreet = toStreet;
        super.toPostcode = toPostcode;
    }


    private List<ProductServiceRel> services = new ArrayList();

    public List<ProductServiceRel> getServices() {
        return services;
    }

    public void setServices(List<ProductServiceRel> services) {
        this.services = services;
    }


    //订单直接计算
    public QuotationCalcObject(String orderNo) {
        this.orderNo = orderNo;
    }

    //无订单试算
    public QuotationCalcObject(int customerId, String cargoTypeCode,
                               BigDecimal weight, BigDecimal volume, String unitCode,
                               String fromCountry, String fromProvince,
                               String fromCity, String fromArea, String fromStreet,
                               String fromPostcode,
                               String toCountry, String toProvince,
                               String toCity, String toArea, String toStreet,
                               String toPostcode) {
        this.customerId = customerId;
        this.cargoTypeCode = cargoTypeCode;
        this.weight = weight;
        this.volume = volume;
        super.weightUnit = unitCode;
        this.fromCountry = fromCountry;
        this.fromProvince = fromProvince;
        this.fromCity = fromCity;
        this.fromArea = fromArea;
        this.fromStreet = fromStreet;
        this.fromPostcode = fromPostcode;
        this.toCountry = toCountry;
        this.toProvince = toProvince;
        this.toCity = toCity;
        this.toArea = toArea;
        this.toStreet = toStreet;
        this.toPostcode = toPostcode;
    }




    private Map<String, ProductServiceRel> productServiceRelMap = new HashMap<>();

    public Map<String, ProductServiceRel> getProductServiceRelMap() {
        return productServiceRelMap;
    }

    public void setProductServiceRelMap(Map<String, ProductServiceRel> productServiceRelMap) {
        this.productServiceRelMap = productServiceRelMap;
    }
    public int getCustomerId() {
        return customerId;
    }

    public void setCustomerId(int customerId) {
        this.customerId = customerId;
    }


    public String getCurrencyCode() {
        return currencyCode;
    }

    public void setCurrencyCode(String currencyCode) {
        this.currencyCode = currencyCode;
    }


    public String getComboCode() {
        return comboCode;
    }

    public void setComboCode(String comboCode) {
        this.comboCode = comboCode;
    }


    public String getCustCurrencyCode() {
        return custCurrencyCode;
    }

    public void setCustCurrencyCode(String custCurrencyCode) {
        this.custCurrencyCode = custCurrencyCode;
    }

    public BigDecimal getCustCurrencyAmount() {
        return custCurrencyAmount;
    }

    public void setCustCurrencyAmount(BigDecimal custCurrencyAmount) {
        this.custCurrencyAmount = custCurrencyAmount;
    }

    public BigDecimal getExchangeRate() {
        return exchangeRate;
    }

    public void setExchangeRate(BigDecimal exchangeRate) {
        this.exchangeRate = exchangeRate;
    }

    public boolean isExchangeRateSetting() {
        return isExchangeRateSetting;
    }

    public void setExchangeRateSetting(boolean exchangeRateSetting) {
        isExchangeRateSetting = exchangeRateSetting;
    }

    public List<String> getAssignedServiceUids() {
        return assignedServiceUids;
    }

    public void setAssignedServiceUids(List<String> assignedServiceUids) {
        this.assignedServiceUids = assignedServiceUids;
    }

    public BigDecimal getAnnouncePrice() {
        return announcePrice;
    }

    public void setAnnouncePrice(BigDecimal announcePrice) {
        this.announcePrice = announcePrice;
    }

    public int getStartPort() {
        return startPort;
    }

    public void setStartPort(int startPort) {
        this.startPort = startPort;
    }

    public int getEndPort() {
        return endPort;
    }

    public void setEndPort(int endPort) {
        this.endPort = endPort;
    }

    public boolean isFromPre() {
        return isFromPre;
    }

    public void setFromPre(boolean fromPre) {
        isFromPre = fromPre;
    }

    public List<String> getOptionServices() {
        return optionServices;
    }

    public void setOptionServices(List<String> optionServices) {
        this.optionServices = optionServices;
    }

    public boolean isCalcAlloption() {
        return isCalcAlloption;
    }

    public void setCalcAlloption(boolean calcAlloption) {
        isCalcAlloption = calcAlloption;
    }

    public boolean isTry() {
        return isTry;
    }

    public void setTry(boolean aTry) {
        isTry = aTry;
    }
}
